<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sb" uri="/struts-bootstrap-tags"%>
<!DOCTYPE html>
<html>
<head>
<s:include value="/WEB-INF/content/common/header.jsp"></s:include>
</head>
<body class="bg">
	<div class="container">
		<s:include value="/WEB-INF/content/common/title-head.jsp"></s:include>

		<div class="content">

			<s:include value="/WEB-INF/content/common/tab.jsp"></s:include>

			<script>
				$("#systemUserTab").addClass("active");
			</script>

			<div id="body">
				<div class="row">
					<div class="col-lg-10 col-lg-offset-1">
						<div class="title">
							<h2>
								<s:if test="mode.name().equals('ADD')">
									<s:text name="page.heading.add" />
								</s:if>
								<s:elseif test="mode.name().equals('EDIT')">
									<s:text name="page.heading.edit" />
								</s:elseif>
							</h2>
						</div>
					</div>
					<div class="col-lg-10 col-lg-offset-1">
						<div>
							<s:form action="save" namespace="/systemUser" method="post"
								theme="bootstrap">
								<s:hidden name="mode" />
								<s:hidden name="systemUser.id" />
								<div class="form-group">
									<s:actionerror />
								</div>
								<fieldset>
									<div class="form-group">
										<s:text name="user.name" />
										<s:textfield name="systemUser.name" cssClass="form-control"
											placeholder="%{getText('user.system.name.placeholder')}"
											required="true" />
									</div>
									<div class="form-group">
										<s:text name="user.email" />
										<s:textfield name="systemUser.email" cssClass="form-control"
											placeholder="%{getText('user.system.email.placeholder')}"
											required="true" />
									</div>
									<div class="form-group">
										<s:text name="user.password" />
										<s:password name="systemUser.userPassword"
											cssClass="form-control"
											placeholder="%{getText('user.system.password.placeholder')}"
											showPassword="true" required="true" />
									</div>
									<div class="form-group">
										<s:text name="user.type" />
										<s:textfield name="systemUser.userType"
											cssClass="form-control" required="true" readonly="true" />
									</div>

									<div class="text-center"></div>
									<div class="text-center">
										<s:submit cssClass="btn btn-primary"
											value="%{getText('global.submit')}" />
										<s:if test="mode.name().equals('EDIT')">
											<s:url var="deleteUserUrl" action="delete"
												namespace="/systemUser" includeParams="none"
												escapeAmp="false">
												<s:param name="id" value="%{id}" />
											</s:url>
											<s:a href="%{#deleteUserUrl}"
												onclick="return confirmDelete()"
												cssClass="btn btn-warning">
												<s:property value="%{getText('global.delete')}" />
											</s:a>
										</s:if>
									</div>
								</fieldset>
							</s:form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<s:include value="/WEB-INF/content/common/footer.jsp"></s:include>
	</div>
</body>
</html>
